package cn.kgc.springcloud.web.controller;

import cn.kgc.springcloud.web.form.StudentForm;
import cn.kgc.springcloud.web.response.ResponseResult;
import cn.kgc.springcloud.web.service.StudentService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 课工场
 * @date 2024/7/29
 * @description
 */
@RestController
@RequestMapping("student")
public class StudentController {

    @Resource
    private StudentService studentService;

    @GetMapping
    public ResponseResult studentList(){

        return studentService.studentList();
    }


    @PostMapping
    public ResponseResult addStudent(@RequestBody StudentForm studentForm){

        return studentService.addStudent(studentForm);
    }
}
